<template>
  <view class="content">
    <view v-if="userInfo">
      <Follow ref="Follow" :name="userInfo.loginname" />
    </view>
    <NoLogin v-else />
    <TabBar />
  </view>
</template>

<script>
import { mapState } from "vuex";
import NoLogin from "@/components/noLogin";
import TabBar from "@/components/TabBar";
import Follow from "@/components/follow";
export default {
  components: {
    TabBar,
    NoLogin,
    Follow,
  },
  computed: {
    ...mapState("user", ["userInfo"]),
  },
  onShow() {
    if (this.userInfo) {
      this.$nextTick(() => {
        this.$refs.Follow.init();
      });
    }
  },
};
</script>

<style>
</style>
